﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace TwlNS
{
    class RectField : Environment
    {
        /// <summary>
        /// Initializes a new instance of the RectField class.
        /// </summary>
        public RectField(double width, double height)
        {
            _Width = width;
            _Height = height;
        }

        public override void AddNodesAndRandomDistribute(List<Node> nodes)
        {
			Random r = UseRandomVariableSeed ? new Random(RandomVariableSeed) : new Random();
            foreach (Node n in nodes)
            {
                double rand_value = r.NextDouble();
                double x = rand_value * _Width;
                rand_value = r.NextDouble();
                double y = rand_value * _Height;
                Coord coord = new Coord(x, y);
                n.Location = coord;
                System.Threading.Thread.Sleep(1);
            }
			base.AddNodesAndRandomDistribute(nodes);
        }

    }
}
